package com.rttmall.shopbackend.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang.StringUtils;
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum VirtualStatus {
	NOT_GRANT(0, "未发放"),
	GRANT(1, "已发放")

    ;

    /* 编码 */
    private Integer code;

    /* 描述 */
    private String text;

    public void setCode(Integer code) {
		this.code = code;
	}
	public void setText(String text) {
		this.text = text;
	}
	VirtualStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }
    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static VirtualStatus getEnums(Integer code) {
        for (VirtualStatus enums : values()) {
        	if (code==enums.getCode()) {
                return enums;
            }
        }
        return null;
    }
}
